home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / amiga / gui / prcgntn1.lha / Precognition / source / PObjectClass.h < prev    next >
C/C++ Source or Header  |  1992-12-23  |  1KB  |  50 lines

  1. #ifndef OBJECTCLASS_H
  2. #define OBJECTCLASS_H
  3.  
  4. /* ==========================================================================
  5. **
  6. **                               PObjectClass.h
  7. **
  8. **   ⌐1991 WILLISoft
  9. **
  10. ** ==========================================================================
  11. */
  12.  
  13. #include "PObject.h"
  14.  
  15. /* PObjectClass contains pointers to the methods (functions)
  16. ** applicable to type PObject.
  17. **
  18. ** CONVENTIONS:
  19. **
  20. **    The structure which describes the class 'Abc' is
  21. **    always named 'struct AbcClass'.
  22. **
  23. **    The function that returns a pointer to the class structure is
  24. **    'struct AbcClass *AbcClass();'.
  25. */
  26.  
  27. #define OBJECTMETHODS \
  28.    Class *isa;        \
  29.    char  *ClassName;  \
  30.    void  (*CleanUp)( PObject *self );
  31.  
  32. struct PObjectClass
  33. {
  34.    OBJECTMETHODS
  35. };
  36.  
  37. void PObjectClass_Init( struct PObjectClass *class );
  38.  
  39. const struct PObjectClass *PObjectClass( void );
  40.  
  41. BOOL isa( const PObject *self,
  42.           const Class  *class );
  43.  
  44. /* Returns TRUE of 'self' is one of 'class', or its descendents. */
  45.  
  46. char *PObjectName( PObject *self );
  47.  
  48. void SetPObjectName( PObject *self, char *name );
  49.  
  50. #endif